package pers.liyan.shi.springcloud.producerticketcore.service;

import org.springframework.stereotype.Service;
import pers.liyan.shi.springcloud.producerticketcore.domain.Ticket;

import java.util.Date;

/**
 * ticketService
 *
 * @author shily
 * @date 2019/4/21 0:19
 */
@Service
public class TicketService {


    /**
     * 买票
     *
     * @param movieName 电影名称
     * @return pers.liyan.shi.springcloud.producerticketcore.domain.Ticket
     * @author shily
     * @date 2019/4/21 0:20
     */
    public Ticket buyTicket(String movieName) {
        //模拟超时引起的调用失败
       /* try {
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
        return new Ticket(movieName,
                new Date(),
                "万达2号厅8排7座");
    }

}
